'use strict';

var mongoose = require('mongoose');
var modelPlugin = require("../model.plugin");
var Schema = mongoose.Schema;
var ObjectId  = Schema.ObjectId;

var topicSchema = new Schema({
  name: {type: String},

  createdAt: {type: Date, default: Date.now},
  createdBy: {type: ObjectId, ref: 'User'},
  updatedAt: {type: Date, default: Date.now},
  updatedBy: {type: ObjectId, ref: 'User'}
});

topicSchema.plugin(modelPlugin);
// topicSchema.index({name: 1});

mongoose.model('Topic', topicSchema);
